package com.prjsystem.interceptor;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
import com.prjsystem.common.constant.CMSConstant;
import com.prjsystem.entity.UserInfo;
@SuppressWarnings("serial")
public class MyInterceptor extends AbstractInterceptor {
	@Override
	public String intercept(ActionInvocation actioninvorcation)throws Exception {
		UserInfo userInfo=(UserInfo)ActionContext.getContext().getSession()
				.get(CMSConstant.USERINFO);
		if (null != userInfo) {
			return actioninvorcation.invoke();
		} else {
			return Action.LOGIN;
		}
	}
}
